package com.chis.jmdatatimer.comm;

import com.chis.jm.pojo.Inoculation;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import redis.clients.jedis.ShardedJedis;

/**
 * @Description 查询儿童免疫史
 * @Company zwx
 * @author jw
 * @version 2016年6月23日
 */
public class RedisFindInocTx implements TransactionJedis {
	/**日志*/
	private static Logger log = LogManager.getLogger(RedisFindInocTx.class);
	/** 儿童编码 */
	private String chilCode;
	/** 儿童免疫史 */
	private List<Inoculation> inoculationList;

	public RedisFindInocTx(String chilCode) {
		this.chilCode = chilCode;
	}

	@Override
	public void run(ShardedJedis jedis) throws Exception {
		try {
			jedis.select(4);
			inoculationList = (List<Inoculation>) JedisSerializeUtil.unserialize(jedis.get(chilCode.getBytes()));
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			throw new Exception(e.getMessage());
		}
	}

	public List<Inoculation> getInoculationList() {
		return inoculationList;
	}

}